package com.ssy.lingxi.common.response;

import javax.validation.constraints.NotEmpty;

/**
 * 统一返回失败数据模型
 */
public class WrapperFail {

    /**
     *  状态码
     */
    @NotEmpty
    private int code;
    /**
     *  提示信息
     */
    @NotEmpty
    private String message;

    public WrapperFail() {
    }

    public static WrapperFail fail(String errorMessage) {
        return new WrapperFail(ResponseCode.BUSINESS_ERROR.getCode(), errorMessage);
    }

    public static WrapperFail fail(int responseCode, String errorMessage) {
        return new WrapperFail(responseCode, errorMessage);
    }


    private WrapperFail(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
